package com.xsh.gls.webconfig;

import com.xsh.gls.interceptor.MyHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class MyWebMvcConfig extends WebMvcConfigurationSupport{
    @Autowired
    MyHandlerInterceptor myHandlerInterceptor;
    protected void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration registration = registry.addInterceptor(myHandlerInterceptor);
        registration.addPathPatterns("/**").excludePathPatterns("/first/**").excludePathPatterns("/error");
    }


}
